
import java.io.PrintWriter;

class DotStatement extends Statement {
	private Node var1_;
	private Node var2_;
	private String type_;
	private String content_;

	public DotStatement(Node v1, Node v2, String t, String c) {
		var1_ = v1;
		var2_ = v2;
		type_ = t;
		content_ = c;
	}

	public DotStatement(Node v1, Node v2, String t) {
		var1_ = v1;
		var2_ = v2;
		type_ = t;
	}

	public DotStatement(Node v, String t, String c) {
		var1_ = v;
		type_ = t;
		content_ = c;
	}

	public DotStatement(Node v, String t) {
		var1_ = v;
		type_ = t;
	}

	public void print(PrintWriter pw) {
		pw.println("Node name : DotStatement");
		var1_.print(pw);
		if (var2_ != null) {
			var2_.print(pw);
		}
		pw.println("Type is : " + type_);
		pw.println("Content is : " + content_);
	}
	public String translate(PrintWriter pw,String condition){
               if( type_.equals("remove")){
               		var1_.translate(pw,"remove");
			if(var2_!=null){
				pw.print(".");
				var2_.translate(pw,"remove");
			}
	  	   	pw.print(".remove");
			}	
	           else if(type_.equals("add")){
			var1_.translate(pw,"add");
			if(var2_!=null) {
				pw.print(".");
				var2_.translate(pw,"add");
			}
			pw.print(".add");	
		 	}
		   else if(type_.equals("removeAll")){
			pw.print(".");
			var1_.translate(pw,"removeAll");
		}
		pw.print("(");
		if(content_ != null){
               		 pw.print(content_);
		}	
         	pw.print(")");	
		return null;	
	}      
}
